import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;

public class EnemySprite extends Sprite{
    private int enemyX = 0;
    private int enemyY = 0;

    public EnemySprite(Image image, int frameWidth, int frameHeight) {
        super(image, frameWidth, frameHeight);
        defineReferencePixel(frameWidth / 2, frameHeight / 2);      
    }


    public void forward(Sprite enemySprite, int enemySpeed) {
         enemyX = enemySprite.getX() - enemySpeed;
         enemySprite.setPosition(enemyX, enemySprite.getY());
    }

    public void forwardDiagDown(Sprite enemySprite, int enemySpeed) {
         enemyX = enemySprite.getX() - enemySpeed;
         enemyY = enemySprite.getY() + enemySpeed;
         enemySprite.setPosition(enemyX, enemyY);
    }

    public void forwardDiagUp(Sprite enemySprite, int enemySpeed) {
         enemyX = enemySprite.getX() - enemySpeed;
         enemyY = enemySprite.getY() - enemySpeed;
         enemySprite.setPosition(enemyX, enemyY);
    }

     public void down(Sprite enemySprite, int enemySpeed) {
         enemyY = enemySprite.getY() + enemySpeed;
         enemySprite.setPosition(enemySprite.getX(), enemyY);
    }

    public void up(Sprite enemySprite, int enemySpeed) {
         enemyY = enemySprite.getY() - enemySpeed;
         enemySprite.setPosition(enemySprite.getX(), enemyY);
    }

     public void backDiagDown(Sprite enemySprite, int enemySpeed) {
         enemyX = enemySprite.getX() + enemySpeed;
         enemyY = enemySprite.getY() + enemySpeed;
         enemySprite.setPosition(enemyX, enemyY);
    }

    public void backDiagUp(Sprite enemySprite, int enemySpeed) {
         enemyX = enemySprite.getX() + enemySpeed;
         enemyY = enemySprite.getY() - enemySpeed;
         enemySprite.setPosition(enemyX, enemyY);
    }
    
}
